#include "Cpoint.h"

Cpoint::Cpoint(): x(0), y(0){}

Cpoint::Cpoint(const Cpoint& pt): x(pt.x), y(pt.y){}

Cpoint::Cpoint(const int xx, const int yy): x(xx), y(yy){}

Cpoint& operator++(Cpoint& pt)
{
	pt.x++;
	pt.y++;
	return pt;
}

Cpoint operator++(Cpoint& pt, int k)
{
	Cpoint temp(pt);
	pt.x++; pt.y++;
	return temp;
}

Cpoint operator+(const Cpoint a, const Cpoint b)
{
	Cpoint temp(a.x+b.x, a.y+b.y);
	return temp;
}

std::istream& operator>>(std::istream& in, Cpoint& pt)
{
	in >> pt.x >> pt.y;
	return in;
}

std::ostream& operator<<(std::ostream& out, Cpoint pt)
{
	out << "x = " << pt.x << "; y = " << pt.y << ";";
	return out;
}
